package com.zut.config;

import com.zut.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 *  扩展MVC的配置类
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    //注册自定义拦截器
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/userpage")
                .addPathPatterns("/shop");
    }

}
